home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Programming / imageio.lib / dev / examples / writeformats / main.c next >
Encoding:
C/C++ Source or Header  |  2000-08-09  |  950 b   |  46 lines

  1. /* This example use of imageio.library displays all the formats the are
  2.         writeable.
  3. */
  4.  
  5. #include <stdio.h>
  6.  
  7. #include <dos/dos.h>
  8. #include <exec/memory.h>
  9. #include <exec/types.h>
  10.  
  11. #include <clib/dos_protos.h>
  12. #include <clib/exec_protos.h>
  13. #include <clib/intuition_protos.h>
  14.  
  15. #include <pragmas/dos_pragmas.h>
  16. #include <pragmas/exec_pragmas.h>
  17. #include <pragmas/intuition_pragmas.h>
  18.  
  19. #include <imageio/imageio.h>
  20. #include <imageio/imageio_protos.h>
  21. #include <imageio/imageio_pragmas.h>
  22.  
  23. /* Function prototypes */
  24.  
  25. extern struct Library *DOSBase;
  26. struct Library *ImageIOBase, *IntuitionBase;
  27.  
  28. void main( int argc, char **argv )
  29. {
  30.     ImageIOBase = OpenLibrary( "imageio.library", 3 );
  31.     if ( ImageIOBase )
  32.     {
  33.         void *handle = NULL;
  34.         ULONG format;
  35.  
  36.         printf( "Writeable image formats:\n");
  37.  
  38.         while ( ( format = format = GetAvailWriteFormat( &handle ) ) != IMGF_UNKNOWN )
  39.         {
  40.             printf( "\tformat %ld\n", format );
  41.         };
  42.  
  43.         CloseLibrary( ImageIOBase );
  44.     }
  45. }
  46.